import React from 'react';
import {NavLink} from "react-router-dom";

function MyNavLink(props) {
    return (
        <nav>
            <NavLink className={({isActive})=>{
                // console.log("首页",options);
                // return "a-link";
                return isActive?"a-active":"a-link"
            }} to={"/"}>首页</NavLink>
            <NavLink className={(options)=>{
                // console.log("商品列表",options)
                // return "a-link";
                return options.isActive?"a-active":"a-link"
            }} to={"/goodsList"}>商品列表</NavLink>
            <NavLink className={({isActive})=>isActive?"a-active":"a-link"} to={"/newsList"}>新闻列表</NavLink>
            <NavLink className={({isActive})=>isActive?"a-active":"a-link"} to={"/my"}>个人中心</NavLink>
        </nav>
    );
}

export default MyNavLink;